package com.extend_.ExtendsExercise;

/**
 * @Author 小闽
 * @Date 2024/8/9 21:54
 * @PackageName: com.extend_.ExtendsExercise
 * @ClassName: Computer
 * @Description: 继承练习
 * @Version 1.0
 */
public class Computer {
    private String cpu;
    private int memory;
    private int disk;
    // 构造器(有参)
    public Computer(String cpu, int memory, int disk) {
        this.cpu = cpu;
        this.memory = memory;
        this.disk = disk;
    }

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public int getMemory() {
        return memory;
    }

    public void setMemory(int memory) {
        this.memory = memory;
    }

    public int getDisk() {
        return disk;
    }

    public void setDisk(int disk) {
        this.disk = disk;
    }

    // 返回Computer的信息
    public String getDetails(){
        return "cpu=" + cpu + "\n" + "memory=" + memory +"\n" +"disk= " + disk;
    }
}
